//	ID : pallab81
// 	PROG : 10871
// 	LANG : C++
// 	2011-09-09-10.59.00 Friday
//
// 	"I have not failed, I have just found 10000 ways that won't work.
//


#include <iostream>
#include <algorithm>
#include <vector>
#include <sstream>
#include <fstream>
#include <string>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <functional>
#include <bitset>

#include <ctime>
#include <cassert>
#include <cstdio>
#include <cmath>
#include <cstring>
#include <climits>
#include <cstring>
#include <cstdlib>

using namespace std;

#define VI vector< int >
#define CI( x ) scanf("%d",&x)
#define CL( x ) scanf("%lld",&x)
#define CD( x ) scanf("%lf",&x )
#define foR(i,st,ed) for(int i = st ; i < ed ; ++i )
#define fo(i,ed) for(int i = 0 ; i < ed ; ++i )
#define foE(i,st,ed) for(int i = st ; i <= ed ; ++i )
#define foit(i, x) for (typeof((x).begin()) i = (x).begin(); i != (x).end(); i++)
#define bip system("pause")
#define Int long long
#define pb push_back
#define SZ(X) (int)(X).size()
#define LN(X) (int)(X).length()
#define mk make_pair
#define f first
#define s second
#define SET( ARRAY , VALUE ) memset( ARRAY , VALUE , sizeof(ARRAY) )

inline void wait( double seconds ){
    double endtime = clock()+( seconds* CLOCKS_PER_SEC );
    while( clock() < endtime ){
        ;
    }
}
const int inf =(int)1e7+10000 ;
//const int inf =(int)1e8+10000 ;
int n;
int vi[10001];
bool primes[ inf+10 ];
int dp[10005][10005];

inline bool isPrime(int x){
    return ( (x&1) && primes[x] ) ;
}
inline void sieve(){
    SET(primes,1);
    int sqrtN = (int)sqrt( (double)inf );
    int i,j;
    for(i=3;i<=sqrtN;i+=2){
        if( primes[i]!=0 ){
            for(j=i*i; j<inf; j+=i ){
                primes[j]=0;
            }
        }
    }
    primes[0]=primes[1]=0;
}
inline void Read(){
    CI(n);
    fo(i,n){
        CI(vi[i]);
    }
}
inline void dpit(){
    //SET(dp,0);
    int i,j;
    int best= (int)30001;
    int indx=-1;
    for(i=1;i<=n;++i){
        dp[i][1]=vi[i-1];
        for(j=2;j<=i;++j){
            dp[i][j] = dp[i][j-1]+dp[i-j+1][1];
            if( isPrime(dp[i][j]) ){
                if( j<best ){
                    best=j;// j holo length
                    indx=i;// i holo end index
                }
            }
        }
    }
    if( indx==-1 ){
        printf("This sequence is anti-primed.\n");
        return ;
    }

    printf("Shortest primed subsequence is length %d:",best);
    for(i=indx-best; i<indx; ++i){
        printf(" %d",vi[i]);
    }
    printf("\n");

}
inline void Proc(){
    dpit();
}
int main(){
//    #ifndef ONLINE_JUDGE
//        freopen("in.txt","rt",stdin);
//    #endif
    sieve();
    int cases=1;
    for( CI(cases) ; cases ; --cases ){
            Read();
            Proc();
    }

return 0;
}
